Repository navigation
Merge esp-rs/esp-hal main into feature/ble-host-npl-upstream - #3
Merged
Lakier15 merged 229 commits intoNov 4, 2026
Merged
Conversation
* specify version in esp-bootloader def of esp-storage * Release 7 packages - esp-radio-rtos-driver: 0.3.0 → 0.4.0 - esp-alloc: 0.10.0 → 0.11.0 - esp-println: 0.17.0 → 0.18.0 - esp-rtos: 0.3.0 → 0.4.0 - esp-storage: 0.9.0 → 0.10.0 - esp-backtrace: 0.19.0 → 0.20.0 - esp-bootloader-esp-idf: 0.5.0 → 0.6.0
* xtask: re-read manifests in execute-plan apply loop The preflight loop parsed every package manifest up front and the apply loop reused those in-memory copies. Bumping a package rewrites the on-disk manifests of its workspace dependents, so a package bumped after its dependencies had those rewrites on disk - but its own bump step then saved its stale pre-bump snapshot, silently reverting them. esp-hal is bumped last and depends on nearly every other released crate, so it lost all of its intra-workspace dependency bumps (e.g. the esp-config build-dependency stayed at the old requirement), which broke the release build. Re-read each manifest from disk immediately before bumping so dependency rewrites from earlier steps are preserved. Regression from esp-rs#5644, which moved the manifest load into an up-front preflight loop and reused the parsed copies. Co-authored-by: Cursor <cursoragent@cursor.com> * xtask: make release PR upsert idempotent find_existing_pr can miss a just-created PR because GitHub's PR listing lags for a moment after execute-plan force-pushes the release branch. On a re-run the lookup returned nothing, so `gh pr create` ran a second time and re-applied every release label and re-requested code-owner reviews, which showed up as duplicated PR timeline entries. Recover from `gh pr create`'s "a pull request ... already exists" error by parsing the existing PR number and editing that PR (title and body only) instead of bailing or opening a duplicate. Labels are still applied exactly once, on first creation, so a maintainer removing one to skip its optional CI check is respected. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
* Bulk-apply auto API doc improvements * Re-add removed sentence-end periods
* Clean up * Clear update control bit
* keep 32kHz crystal powered * Manually keep the clock alive
* Test that the max frequency is attainable with default clock source * Restore defaults * Ensure high-speed PLLs are divided down
* fixup mg * Release 3 packages - esp-metadata-generated: 0.5.0 → 0.5.1 - esp-hal: 1.2.0-rc.0 → 1.2.0 - esp-radio-rtos-driver: 0.4.0 → 0.4.1 * fixup mg
* Enable octal PSRAM for P4 * Default to 80MHz PSRAM
* Enable I2S for ESP32-S31 * use achievable rate * Simplify P4/S31 path cfg
* Add interrupt handling for I2S parallel peripheral * Mark I2S parallel structures/enums and methods as unstable; add more interrupt handling functions to I2sParallelTransfer * Refine documentation for I2S parallel interface: adhere to API-DOC-RULES * interrupt management methods on I2sParallelTransfer should only be available in Blocking * hil-test: i2s parallel interrupts
Rsa::disable_constant_time(false) turned constant time off, the opposite of its name. The work queue called it that way, so its RSA operations ran without constant time by default. Replace the two setters with rsa::Config and Rsa::apply_config, as the driver guidelines describe, and have Rsa::new take a Config. Config::default() has constant time on and search acceleration off.
* ECC: add SM2 curve support * ECC: report unsupported curves through OperationError
* ESP32-S3: fix Debug Assist CPU1 PC reads * HIL: align Debug Assist test listing with module order * HIL: run CPU0 region-monitor PC test on single-core chips --------- Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
* WIP S3 experiment * Query stored metrics from app-metrics API * Minor improvements do not end up in the table * add s3-server secret
* Fix spelling in comments, docs, and metadata generator output. * Keep the existing useable spelling.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Reclaim the 64 KiB of boot RAM on the ESP32-S31 Before this change, #[ram(reclaimed)] and DRAM2_UNINIT_SIZE covered only the 8 KiB of the ROM's startup stack on the ESP32-S31. The 56 KiB below it, used by the 2nd stage bootloader and the ROM's download-mode buffers, is also free once the application runs. Programs that sized their heap from DRAM2_UNINIT_SIZE ran out of internal RAM, and Wi-Fi programs panicked at boot when a thread stack could not be allocated. The region now starts at 0x2F06_CFB0 and covers 64 KiB. * Extend the ESP32-S31's DRAM range to the top of SRAM The DRAM range ended at 0x2F07_AFC0, below the top 8 KiB of the reclaimed region. The range now ends at SOC_DRAM_HIGH, 0x2F08_0000.
* set up Python step * bump pinned python version
…-rs#6527) * ci: store API baselines in a GitHub release instead of artifacts * reviews
collapsinghierarchy
marked this pull request as ready for review
October 30, 2026 11:25
|
Keeps upstream's new BLE layout (ble/npl/mod.rs behind the `porting` module, os_mempool, lp_clk) and ports the NPL host additions onto it: the `ble-host-npl` feature, the exported NPL symbols, memory from internal RAM and the HCI buffer handling.
Upstream replaced ble::npl::send_hci with the crate-private porting::send. Keep a thin public wrapper behind the ble-host-npl feature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
esp-nimble-host compiles NimBLE's own os_mempool.c and patches it to zero blocks on allocation. The Rust os_mempool upstream added exports the same symbols, the linker picked it, and recycled event blocks kept their free-list pointer: ble_npl_event_init took it for an initialised event and the host task jumped into ble_hs_hci_os_event_buf (HIL BLE on C5 and C61). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-npl" This reverts commit 87a9b4e.
A recycled block kept the pool's free-list pointer in its first word. ble_npl_event_init takes a non-zero first word for an initialised event, so the NimBLE host ran the stale pointer as an event callback and crashed in ble_hs_hci_os_event_buf (HIL BLE on C5 and C61). esp-nimble-host patched its own os_mempool.c for this, but the controller blob needs this pool (os_mempool_flags_set, os_ext_mempool_register_cb), so the fix has to live here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
collapsinghierarchy
force-pushed
the
wasilij/merge-upstream-main
branch
from
October 30, 2026 11:32
8cc7cc4 to
135a52a
Compare
Lakier15
merged commit Nov 4, 2026
b982947
into
feature/ble-host-npl-upstream
16 of 23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Merges
esp-rs/esp-halmain(up to 5c0820c) intofeature/ble-host-npl-upstream. Our fork-only work (BLE NPL host, internal-RAM NPL memory, C5/C61 PSRAM fix) stays on top.Fork-only diff: esp-rs/esp-hal@5c0820c...peeriot:esp-hal:wasilij/merge-upstream-main
Our changes on this branch
b562c20e, the merge. Upstream movedble/npl.rstoble/npl/mod.rsand addedos_mempool,lp_clkandbtdm2. We kept upstream's layout and ported our NPL host additions onto it: theble-host-nplfeature, the exported NPL symbols,malloc_internal/calloc_internal, and the HCI buffer handling.6fbb1595,321c55d2: keepnpl::send_hcipublic behindble-host-npl. Upstream made it crate-private, andesp-nimble-hostcalls it.135a52ae:os_memblock_getclears the free-list link in a block's first word before handing it out. Without this, the NimBLE host crashes on C5 and C61 (see below).87a9b4e2and its reverte7b8b369: a first attempt that leftos_mempooltoesp-nimble-host. The new controller blob needsos_mempool_flags_setandos_ext_mempool_register_cbfrom upstream's pool, so it did not link.HIL validation
swarm-ci run 41040958588 on peeriot/swarm
wasilij/esp-hal-upstream-bump(fe37db6b, the same tree as this branch's head before the merge commit message was reworded): C5, C6, C61, the C6 signal layer, and BLE on C5 and C61. Result: all jobs pass. One flaky test: on C5,notifications_count_up_until_unsubscribedgot counter value 2 as its first notification on tries 1 and 2 (expected 1), then passed on try 3.Changes the swarm needs (as in the validation run)
Implemented in peeriot/swarm#1672 (private).
Cargo.toml:esp-*crates on branchwasilij/merge-upstream-main;esp32c5/esp32c61on the PAC source esp-hal uses,{ version = "0.4"/"0.5", git = "https://github.com/esp-rs/esp-pacs.git", rev = "5cb8c50" }(deny.tomlbans two versions of a PAC);esp-nimble-hoston branchwasilij/esp-hal-merge-upstream-main(125a9be), which pointsesp-hal/esp-radioat this branch.esp-firmwareandesp-firmware-macros:esp_rtos::start(timer0), because theFROM_CPU_INTR0argument is gone.Cargo.lock: relock the esp crates only. A broad relock movedsparevaltosha20.10 and broke the host build, so keep the other crates' entries as on master.Known issue: NPL event initialisation
ble_npl_event_init(esp-radio/src/ble/npl/mod.rs) treats a non-zeroble_npl_event.dummyas "already initialised" and then skips setting the callback. NimBLE recycles event blocks from a pool that keeps its free-list pointer in exactly that word. A reused block therefore looked initialised, and the stale pointer ran as the callback:Illegal instructioninble_hs_hci_os_event_buf.Before the merge,
esp-nimble-host's patchedos_mempool.chid this by zeroing blocks. Upstream's Rust pool now takes those symbols, and135a52aedoes the minimal part of that zeroing there.Proper fix, as a follow-up:
ble_npl_event_initallocatesEvents from an esp-radio-owned pool, recognises them by pool membership (as ESP-IDF's NPL does), and always setsfn/arg.esp-nimble-hostthen drops itsos_mempool.c(already unlinked since135a52ae) and the zero-on-alloc patch. Theble_hs.cpatch that deinitialises events before returning them stays unless the new design freesEvents another way.Not checked
🤖 Generated with Claude Code